from django.db import models


# 基类
class Base(models.Model):
    # 主键
    id = models.AutoField(primary_key=True)

    class Meta:
        abstract = True


# 用户表
class User(Base):
    # 用户名
    username = models.CharField(max_length=200)
    # 密码
    password = models.CharField(max_length=100)
    # 用户头像
    img = models.ImageField(upload_to='static/upload/')
    # 统计个人主页访问量
    num = models.IntegerField(default=0)

    # 声明表名
    class Meta:
        db_table = 'user'
